package com.yc.store.mapper;

import com.yc.store.bean.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * Company 源辰信息
 *
 * @author navy
 * @date 2024/4/27
 * Email haijunzhou@hnit.edu.cn
 */
@Mapper
public interface UserMapper {

    @Select("select * from user where id=#{id}")
    User selectById(Integer id);

    @Select("select * from user where name = #{name}")
    int selectByName(String name);

    @Select("select * from user where name = #{name} and pwd = #{pwd}")
    User login(User user);

    @Insert("insert into user values (null, #{name}, #{pwd}, #{phone}, #{email})")
    void insert(User user);
}
